<?php $_hidden_elements = array(); ?>

<form class="login_f" <?php foreach ($form->attrs() as $attr => $value): $value = h($value); echo "{$attr}=\"{$value}\" "; endforeach; ?>>

    <?php if ($form->_subject): ?>
    
    <?php endif; ?>

<?php
foreach ($form->elements() as $element):
    if ($element->_ui == 'hidden')
    {
        $_hidden_elements[] = $element;
        continue;
    }
    $id = $element->id;
?>

  <div id="<?php echo $element->id; ?>_wrap" <?php if ($element->_hidden): ?>class="hidden"<?php endif; ?>>
    <?php if ($element->_label): ?><?php endif; ?>

    <?php if ($element->_tips): ?><span class="tips"><?php echo nl2br(str_replace(array('[b]', '[/b]'), array('<strong>', '</strong>'), h($element->_tips))); ?></span><?php endif; ?>

    

    <?php //echo Q::control($element->_ui, $id, $element->attrs()); ?>
    <?php //换成下面这个可以保证输入错误后返回为过滤转换前的数值 ?>
    <?php 
        $attrs = $element->attrs();
        $attrs['value'] = $element->unfilteredValue(); 
        echo Q::control($element->_ui, $id, $attrs);
    ?>

	<?php if (!$element->isValid()): ?>
    <div class="error_tip"><?php echo nl2br(h(implode("，", $element->errorMsg()))); ?></div>
    <?php endif; ?>
  </div>

<?php
endforeach;
?>

    <div class="btn_part">
      <div style="float:left"><img src="<?php echo url('default::default/imgcode'); ?>" style="float:left"/><input type="text" name="codes" id="codes"/></div><input type="submit" name="btn_submit" value="" class="btn" />
    </div>

</form>
